package com.lws.basic.view;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Build;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.github.ybq.android.spinkit.sprite.Sprite;
import com.github.ybq.android.spinkit.style.Circle;
import com.lws.basic.R;
import com.lws.basic.base.BaseDialogFragment;

import java.lang.reflect.Field;


/**
 * @松 on 2019/7/15 13:37
 */
public class LoadingViewDialog extends BaseDialogFragment {


    private TextView mTextView;
    private String mContent;

    public LoadingViewDialog() {

    }
    @SuppressLint("ValidFragment")
    public LoadingViewDialog(String content) {
         mContent =content;
    }

    @Override
    public int setLayoutId() {
        return R.layout.dialog_loading_view;
    }

    @Override
    protected void initWindow(Window window) {
            setLayoutParams(window,Gravity.CENTER, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT,0 ,0 );


    }

    @Override
    protected void initData(View view) {
        super.initData(view);
        // mProgressBar = (ProgressBar)view.findViewById(R.id.spin_kit);
        mTextView = view.findViewById(R.id.tv);
//        ImageView iv = view.findViewById(R.id.iv);
//        RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
//        rotateAnimation.setDuration(1000);
//        LinearInterpolator lin = new LinearInterpolator();
//        rotateAnimation.setInterpolator(lin);
//        rotateAnimation.setRepeatCount(-1);
//
//        iv.startAnimation(rotateAnimation);
        // Sprite doubleBounce = new Circle();
        // Sprite doubleBounce = new FadingCircle();
        //  mProgressBar.setIndeterminateDrawable(doubleBounce);
        mTextView.setText(mContent);

    }





}
